﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace SharePoint.Security.ConfigAnalyzer.Client.Models
{
    public class Rule : INotifyPropertyChanged
    {
        public SharePoint.Security.ConfigAnalyzer.Engine.Base.BaseRule RuleObj { get; set; }

        private string groupDesc = string.Empty;

        public string GroupDesc
        {
            get { return this.groupDesc; }
            set
            {
                if (value != this.groupDesc)
                {
                    this.groupDesc = value;
                    NotifyPropertyChanged("GroupDesc");
                }
            }
        }

        private string status = string.Empty;

        public string Status
        {
            get { return this.status; }
            set
            {
                if (value != this.status)
                {
                    this.status = value;
                    NotifyPropertyChanged("Status");
                }
            }
        }


        private bool isSelected = true;

        public bool IsSelected
        {
            get { return this.isSelected; }
            set
            {
                if (value != this.isSelected)
                {
                    this.isSelected = value;
                    NotifyPropertyChanged("IsSelected");
                }
            }
        }

        private string title = string.Empty;

        public string Title
        {
            get { return this.title; }
            set
            {
                if (value != this.title)
                {
                    this.title = value;
                    NotifyPropertyChanged("Title");
                }
            }
        }

        private string desc = string.Empty;

        public string Description
        {
            get { return this.desc; }
            set
            {
                if (value != this.desc)
                {
                    this.desc = value;
                    NotifyPropertyChanged("Description");
                }
            }
        }

        private string expectedVal = string.Empty;

        public string ExpectedValue
        {
            get { return this.expectedVal; }
            set
            {
                if (value != this.expectedVal)
                {
                    this.expectedVal = value;
                    NotifyPropertyChanged("ExpectedValue");
                }
            }
        }

        private string currentVal = string.Empty;

        public string CurrentValue
        {
            get { return this.currentVal; }
            set
            {
                if (value != this.currentVal)
                {
                    this.currentVal = value;
                    NotifyPropertyChanged("CurrentValue");
                }
            }
        }


        private string groupName = string.Empty;

        public string GroupName
        {
            get { return this.groupName; }
            set
            {
                if (value != this.groupName)
                {
                    this.groupName = value;
                    NotifyPropertyChanged("GroupName");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

}
